#pragma once
#include <stdint.h>
#include <stddef.h>
#include "base/core/com_define.h"

#define INSERT_ERROR_NO(ERR_NO, ERR_STR)    \
  DO_WHILE_MACRO_BEGIN                      \
  int ret = InsertErrorNO(ERR_NO, ERR_STR); \
  if (ret != 0)                             \
    return ret;                             \
  DO_WHILE_MACRO_END(0)

int  InsertErrorNO(uint32_t err_no, const char* err_str);
void GetErrorString(int err_no, char* buf, size_t len);

enum ErrorNumber 
{
	ERROR_NUMBER_START = 0xFFFF,
	ERROR_INVALID_INPUT_PARAM,
	ERROR_INSTERT_VALUE_IS_EXIST,

	ERROR_NUMBER_END
};

int InitErrorTable() 
{
	INSERT_ERROR_NO(ERROR_INVALID_INPUT_PARAM, "invalid input param");
	INSERT_ERROR_NO(ERROR_INSTERT_VALUE_IS_EXIST, "insert value is exist");

	return 0;
}

